package com.wiegand.gui.button.views {
	import com.wiegand.gui.text.CssTextSprite;
	import com.wiegand.util.RoundRectangle;

	import flash.display.MovieClip;
	import flash.display.Sprite;

	/**
	 * @author kwiegand
	 */
	public class ButtonViewMetaNav extends AbstractButtonView {
				
		override public function getUpState( xml : XMLList ) : MovieClip {
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			var s : MovieClip = new MovieClip;
			var t1 : Sprite = CssTextSprite.create( text, style );
			t1.name="btText";
			t1.alpha=0.5;
			s.addChild( t1 );
			var t2 : Sprite = CssTextSprite.create( text, style );
			s.addChild( t2 );
			var recMask : Sprite = RoundRectangle.create(0xffffff,30,1,t1.width,t1.height);
			recMask.name="recMask";
			recMask.scaleX = recMask.scaleY = 0.001;
			recMask.y = t1.height;
			s.addChild(recMask);
			recMask.y = t1.height;
			t2.mask=recMask;
			return s;
		}
		
		override public function getOverState( xml : XMLList ) : MovieClip {
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			var s : MovieClip = new MovieClip;
			var t1 : Sprite = CssTextSprite.create( text, style );
			t1.name="btText";
			t1.alpha=0.5;
			s.addChild( t1 );
			var t2 : Sprite = CssTextSprite.create( text, style );
			s.addChild( t2 );
			var recMask : Sprite = RoundRectangle.create(0xffffff,30,1,t1.width,t1.height);
			recMask.name="recMask";
			recMask.scaleX = recMask.scaleY = 0.001;
			recMask.y = t1.height;
			s.addChild(recMask);
			recMask.y = t1.height;
			t2.mask=recMask;
			return s;
		}
		
		override public function getDownState( xml : XMLList ) : MovieClip {
			var text : String = xml;
			var style : String = xml.attribute( "style" );
			var s : MovieClip = new MovieClip;
			var t1 : Sprite = CssTextSprite.create( text, style );
			t1.name="btText";
			t1.alpha=0.5;
			s.addChild( t1 );
			var t2 : Sprite = CssTextSprite.create( text, style );
			s.addChild( t2 );
			var recMask : Sprite = RoundRectangle.create(0xffffff,30,1,t1.width,t1.height);
			recMask.name="recMask";
			recMask.scaleX = recMask.scaleY = 0.001;
			recMask.y = t1.height;
			s.addChild(recMask);
			recMask.y = t1.height;
			t2.mask=recMask;
			return s;
		}
		
	}
}
